package mrsimulator

import actors.Actor

/**
 * Created with IntelliJ IDEA.
 * User: codefish
 * Date: 11/8/12
 * Time: 9:51 PM
 * To change this template use File | Settings | File Templates.
 */
class ReduceTaskInProgress(t: Task, tt: TaskTrackerSimulator) extends Actor{
    val task = t
    val taskTracker = tt
    val duration = task.getTaskInfo.getCompletionTime

    def act() {
        loop {
            react{
                case Reduce =>
                    Thread.sleep(duration)
                    taskTracker ! TaskDone(task)
            }
        }
    }
}
